UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+3/eKhXeQHwWtgeAxXIUjeCgFeyLe4NEYZszdbDYWmw='
WHERE
key_id = '786192d7201ad866bbd2ce3c95b550d0229207e3d37d103b352c7ad7efcf2c4d'
AND (
token = '+3/eKhXeQHwWtgeAxXIUjeCgFeyLe4NEYZszdbDYWmw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)