UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g41UUruFCfPfxRe9eqPl8EmOe890L4lWhlSW81l6b8E='
WHERE
key_id = '198c8c5862a45ddb0ef22cac234bde494c734fa37e57b76f50203c7dcf44aec2'
AND (
token = 'g41UUruFCfPfxRe9eqPl8EmOe890L4lWhlSW81l6b8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)