UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0GePFmDMHDR+rCH88USFwkf0js4tpsIu/erLpGg9sWA='
WHERE
key_id = '3120a203a2026f9b547ec0e8c4150b41aca43409b917146591a97d8566d01224'
AND (
token = '0GePFmDMHDR+rCH88USFwkf0js4tpsIu/erLpGg9sWA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)