UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z8sriIT/lXKHOnsQTM7qi5i0+Cphh/0kvq7FEV9BSlI=' 
WHERE 
  key_id = '0604d4dd0990d9e4a17afd7059a298d35f5e66455a57a59ac9ef618fce9ee2bf' 
  AND (
    token = 'Z8sriIT/lXKHOnsQTM7qi5i0+Cphh/0kvq7FEV9BSlI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030