UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1yMugU3HUAgcGgVFsBl1Q4kLol2kJ/bif0FrqoiEbnc=' 
WHERE 
  key_id = '74c7bf9eae3e4eb4b716b8682aac287470f194108f67a4b74fb84e65e755156b' 
  AND (
    token = '1yMugU3HUAgcGgVFsBl1Q4kLol2kJ/bif0FrqoiEbnc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042