UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zTblPlVdVuwfuuBuAevmjvf0flSGI1yJIA7LbI5NVnk=' 
WHERE 
  key_id = 'c267fec1b4fb0e47cae710621fd41f0dc6b1767fad899a87c4d51e94e093bc8d' 
  AND (
    token = 'zTblPlVdVuwfuuBuAevmjvf0flSGI1yJIA7LbI5NVnk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044