UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MS+k1OJsQD3XVq4MIA/YQx0+rAKVZfwt1MlPv9cKpsE=' 
WHERE 
  key_id = '7f0b45416fd0a962b89032775b4859d3ab9190c0ff545730d0225f6a152bbd57' 
  AND (
    token = 'MS+k1OJsQD3XVq4MIA/YQx0+rAKVZfwt1MlPv9cKpsE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042