UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cZrEGtAJHoIjeWC09dx7xtoihAIZ6tRPQ0Vv1pS2zsg=' 
WHERE 
  key_id = '69b255cbffafd764930b3d5283a9518f876f6aa302c2e9b26defde4b8e81e253' 
  AND (
    token = 'cZrEGtAJHoIjeWC09dx7xtoihAIZ6tRPQ0Vv1pS2zsg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023