UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5HIXJWMiKfHfQtd9q17vBm+zKVZHPsFeTwG7AM8KO4Q=' 
WHERE 
  key_id = '9bcd3cdc9207956711deb05138c8c66b079e576df3161ffb94a4bca43681d7f2' 
  AND (
    token = '5HIXJWMiKfHfQtd9q17vBm+zKVZHPsFeTwG7AM8KO4Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030