UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iBbFZBEIenJ1bPQ16+2DkZmzKo+3UzBFNMOBKy0hDvM=' 
WHERE 
  key_id = '9445ea32f542b4a812a08ee778fe1042b041c58bce19bf4c2826f0d8ec572614' 
  AND (
    token = 'iBbFZBEIenJ1bPQ16+2DkZmzKo+3UzBFNMOBKy0hDvM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017