UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xL+z5wjriofo8YZWudKEOLFTBoW3LoNpR55m1OnjgIM=' 
WHERE 
  key_id = '460d8dcc6d39c7fa46bd717a8d31beafe02887b32a73aa0da3e8cdf9d93b52f2' 
  AND (
    token = 'xL+z5wjriofo8YZWudKEOLFTBoW3LoNpR55m1OnjgIM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037