UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5dFqoHzObFOHgnNfDm29J5bCrNNPJZ86AzbxZZWMXks=' 
WHERE 
  key_id = '761656c7e67dd9283f2c4ee7617be6d2af97311f9bb47d9cbb4147dedddedc01' 
  AND (
    token = '5dFqoHzObFOHgnNfDm29J5bCrNNPJZ86AzbxZZWMXks=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014