UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vH8PxUKyOEAA0wsdE/dGNG08N2YTEg1q+PRSRfQg7fM=' 
WHERE 
  key_id = '57d467c7173e9396837a7e6d8094bee160921ed32bd89eb0ad09414e8fedcb43' 
  AND (
    token = 'vH8PxUKyOEAA0wsdE/dGNG08N2YTEg1q+PRSRfQg7fM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039