UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QBfNAxe0y32ZMqylJ1ytwtvjKBcEsFSY02qHpsfuMhc=' 
WHERE 
  key_id = '22f1ce5d0fd009d0d852c3958511223aba945508f5d17e223c3c9db1c88f2e5f' 
  AND (
    token = 'QBfNAxe0y32ZMqylJ1ytwtvjKBcEsFSY02qHpsfuMhc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028