UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/jeHBBGwCDqEuyKihGJXVJIZKvXxB1jYQcAi/srokyg='
WHERE
key_id = 'a26437c7e9901f12b846951bde253ef62513ceceeb09ff1ea9bd0d83dfdf95d8'
AND (
token = '/jeHBBGwCDqEuyKihGJXVJIZKvXxB1jYQcAi/srokyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)