UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4QuiYQmG1y+MHRy2GkiTVDqfhTmoxz73vUQCfQF6THc=' 
WHERE 
  key_id = 'c0b7f4b6164b0f822f382909d4391a5f459b3fb2a9560d934b5fc22a1611aaec' 
  AND (
    token = '4QuiYQmG1y+MHRy2GkiTVDqfhTmoxz73vUQCfQF6THc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033