UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2HWBn0cRUqAZZMorvSfFfiar4udHMAAskL0iKfQTxko=' 
WHERE 
  key_id = '68d77edce55c11487e5adadbfde8de41f7b28ad588874e9136e79a7f7b5f7594' 
  AND (
    token = '2HWBn0cRUqAZZMorvSfFfiar4udHMAAskL0iKfQTxko=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022