UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5so9+EF0tLIfKC9/aDjdjZFKTlhZRuajz5xMTXmmv7g=' 
WHERE 
  key_id = 'd3f217f59293a538aace2d5e31108a1451d3c57d3c0c3708a02c65415c31ad0e' 
  AND (
    token = '5so9+EF0tLIfKC9/aDjdjZFKTlhZRuajz5xMTXmmv7g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021