UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9G867QPYJPt7GYGi3HPU4Om3Cjfdaxy8vrvHRifSUtA=' 
WHERE 
  key_id = '044f9b0f30b8cb450ca54d59f1b23364f8c62e6deda2afe9a6f2c5a14987946e' 
  AND (
    token = '9G867QPYJPt7GYGi3HPU4Om3Cjfdaxy8vrvHRifSUtA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030