UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J0no/5eRF/2hWU2iBU2wVfh+3Kyo0hzNCPJZfL0dEjU=' 
WHERE 
  key_id = 'ef1a98b35d27355d66e9fdfbf9317a7255827d95f9ca13b0ccd3943f6c5b8794' 
  AND (
    token = 'J0no/5eRF/2hWU2iBU2wVfh+3Kyo0hzNCPJZfL0dEjU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026