UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8Vr3a9dSQvR0y7abzJS4EuSrF/b0kezfUjsobGsRAis=' 
WHERE 
  key_id = '7d635218bb19a492aa83f0963a7b362803cc6a82b5ac7d59f1489f794c7fbf73' 
  AND (
    token = '8Vr3a9dSQvR0y7abzJS4EuSrF/b0kezfUjsobGsRAis=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033