UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PvJH9sgoF2zlus2Gxh7CXFu+SPVcS5wVTAYDBd/K9Vs='
WHERE
key_id = '044754ac12cc7b2f832b7e757160e54eb43a8317d5b2727d9edba34c68c70a5e'
AND (
token = 'PvJH9sgoF2zlus2Gxh7CXFu+SPVcS5wVTAYDBd/K9Vs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)