UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tyWbaoVQ2+ZXTlvxnJXaQTjilIZrcjevYcHNI9XaWdY=' 
WHERE 
  key_id = 'af37954d29d14d8cad06e342a94eb76cb33c9d1a8cf5685012bb1db42cf428ac' 
  AND (
    token = 'tyWbaoVQ2+ZXTlvxnJXaQTjilIZrcjevYcHNI9XaWdY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044