UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9m3q38zeacVhvOvqPCnH0pw254HptGoxBSl1pqCoeco=' 
WHERE 
  key_id = '9828982ed0db4ed8c6dfc8f0eab3d63fab0f5c724c12f16715148e88e1966d0c' 
  AND (
    token = '9m3q38zeacVhvOvqPCnH0pw254HptGoxBSl1pqCoeco=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018