UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '429m1tlrnFZdi7bFilIIW+nudOIsWYwh9dEKeaZyxDs=' 
WHERE 
  key_id = 'b58a6664d0b225f97ee517cb6380c7abf58b1ac5a4af41677fc12acf95b3c5ef' 
  AND (
    token = '429m1tlrnFZdi7bFilIIW+nudOIsWYwh9dEKeaZyxDs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046