UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '89a/KJAC5SuDnZVVPN+EUq3P7Sg/xfZ7+4r27lvwhm8=' 
WHERE 
  key_id = '5755c2abb79e097a84ea8bd006b8ba4f3cf45d8a55e6a8383950e9f748a9d935' 
  AND (
    token = '89a/KJAC5SuDnZVVPN+EUq3P7Sg/xfZ7+4r27lvwhm8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030