UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rG5ga2DfujzebFAUSFpKdF8nUDLsHkeiH7PveSYQ4HQ=' 
WHERE 
  key_id = '181c6e0300db7cf73ca8bf81afb96393006fd2e2a5fff676054abcd9e7b4d2da' 
  AND (
    token = 'rG5ga2DfujzebFAUSFpKdF8nUDLsHkeiH7PveSYQ4HQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016