UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0hjbfxG3+hDkr1um7Axwv73sLeWo08Dil47BQ5aQB8M='
WHERE
key_id = '196b8038822a5f494bdbae9f18845c13a327183578531a5e29435573132beacb'
AND (
token = '0hjbfxG3+hDkr1um7Axwv73sLeWo08Dil47BQ5aQB8M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)