UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u51/MC2WVSwbUZCiIgkZQkjfSNZ/sao1C/d6UIU2jNk=' 
WHERE 
  key_id = '40eb5671f1e26a6ec8bdfd99fba7d5433b644674ac3ba935ece6e93268ed080e' 
  AND (
    token = 'u51/MC2WVSwbUZCiIgkZQkjfSNZ/sao1C/d6UIU2jNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049