UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RuYMrkJPFgTcVLBsn0N6JuKWPpUYQ/JFkge0iVzHLpg='
WHERE
key_id = '6145dfc679ca1067b3b0e95739c155cc9622890d4d1e6f7da3814e886d973e56'
AND (
token = 'RuYMrkJPFgTcVLBsn0N6JuKWPpUYQ/JFkge0iVzHLpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)