UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dcKStD2UJJsLUhV4AcOeHdWU9lkF/bzykcTUbILruxE=' 
WHERE 
  key_id = 'a69a58cf7196123696ec39a3d62bf6738110b6ce8540e7640fed7f6c75c1b61f' 
  AND (
    token = 'dcKStD2UJJsLUhV4AcOeHdWU9lkF/bzykcTUbILruxE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032