UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qghPKLK5CQZtSw2GOx8FdD6Hn0C/f4eUsN42BOOgKV0=' 
WHERE 
  key_id = '2356937bdcc7f5bd0c9bc25366a3d21fb71ee91e8953d2cb8a41adb0dccfc1b4' 
  AND (
    token = 'qghPKLK5CQZtSw2GOx8FdD6Hn0C/f4eUsN42BOOgKV0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050