UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rbUWn8q3fxDm1KUDF2wr4oKpGOjLzgiATmNCFMS4QoU='
WHERE
key_id = '5a3fc50eafac34cf069b393956de6d6dd423acd4d2ac2b7c3fb4f3cb409b132f'
AND (
token = 'rbUWn8q3fxDm1KUDF2wr4oKpGOjLzgiATmNCFMS4QoU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)