UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'anVjADRoQqx9PIP7aUz1JheseaJn+2BEcAIpeu2ibPY=' 
WHERE 
  key_id = '28bc689eb088f1eb314e6607d12a2298c00dee9fea0c47346440b91d5d722344' 
  AND (
    token = 'anVjADRoQqx9PIP7aUz1JheseaJn+2BEcAIpeu2ibPY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026