UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pdrc/WqjNgJmEnLKi5ID2c4iF0AKpnMbSCid6h2OC6k=' 
WHERE 
  key_id = '57c16c72fead8e1c00b9fd6dee2443e24dc9d59cbbab7b4314150d44dc759ee7' 
  AND (
    token = 'pdrc/WqjNgJmEnLKi5ID2c4iF0AKpnMbSCid6h2OC6k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024