UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '32PefhXX58AXU/ywJL0DOd9T0Ixs+w1ZTNGfqy0nwpk=' 
WHERE 
  key_id = '5d55f5a729464b7a8aaa357416a6a7a0c6680b5b34e621ca5ed1d6f2ab30ffee' 
  AND (
    token = '32PefhXX58AXU/ywJL0DOd9T0Ixs+w1ZTNGfqy0nwpk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029