UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3yn4Jxh4GDDS0aeKwjwuX1t/WbzNbeZbHhPhfSAphBc=' 
WHERE 
  key_id = 'b02373de9a844f23414be613002e8bda7d38e74ddcf1f5cfdd60b81a8bf19a7d' 
  AND (
    token = '3yn4Jxh4GDDS0aeKwjwuX1t/WbzNbeZbHhPhfSAphBc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032