UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/M3IG8xaHreO685opAMYnIRSoBl7b3RhdC9phIuaifA=' 
WHERE 
  key_id = 'ceeb09287302e9006f7f8032d7bdd9b804a8ac7179e0e56a12ccf06d6a0a24d2' 
  AND (
    token = '/M3IG8xaHreO685opAMYnIRSoBl7b3RhdC9phIuaifA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038