UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yk3NB+x4Iy+hei4oInQABiu+v2/kyWUPQrOTwqbXqO4=' 
WHERE 
  key_id = '85ad85cf7c4d614e5b301f7ac14206203f7f975ba7ef93ad1bbd945bb6c3a426' 
  AND (
    token = 'Yk3NB+x4Iy+hei4oInQABiu+v2/kyWUPQrOTwqbXqO4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024