UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bUmHop/jbvF/4l+FA/UdM++mdEmRD2SvLHqBpQh3Qtk=' 
WHERE 
  key_id = 'cb04220ce31dac20fe2ef3405bdbe296df5c87205eb1e4583d181f88280466da' 
  AND (
    token = 'bUmHop/jbvF/4l+FA/UdM++mdEmRD2SvLHqBpQh3Qtk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036