UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w4VYQcQ4zCH/GEZ9R1/jHI4JiXp4nPUfRmYgiMV/V4c='
WHERE
key_id = '8cd1826be30bf49ad04565725db69fb791314fe778928adfef54c1658c4ea60d'
AND (
token = 'w4VYQcQ4zCH/GEZ9R1/jHI4JiXp4nPUfRmYgiMV/V4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)