UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FBQrHfo/P3Z6hWCQ4K2u8yBRUzLIGWJ293bPXOLJsIs=' 
WHERE 
  key_id = '70cb2296a784a8e17e012dfc13378f18f16a843022aabd6f2a76ac3e1ab37bb1' 
  AND (
    token = 'FBQrHfo/P3Z6hWCQ4K2u8yBRUzLIGWJ293bPXOLJsIs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039