UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D7xV73cyCtOuXba6Wx7W0MUkg70iaS/dUpGwJArOrJc=' 
WHERE 
  key_id = 'ff6e1272a1eeb7ad3a093ff784027ac57ef22080943a2aa264be320eb75b0d41' 
  AND (
    token = 'D7xV73cyCtOuXba6Wx7W0MUkg70iaS/dUpGwJArOrJc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029