UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SuYzD6fF1saqW5WfGTPUagCWtpsyk02G9T9Q+LfOr8w=' 
WHERE 
  key_id = '13c7ce527e69410651b889f36548b840b6d81e8e61c1b946b869a8be3d4640c8' 
  AND (
    token = 'SuYzD6fF1saqW5WfGTPUagCWtpsyk02G9T9Q+LfOr8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033