UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1JwHiw1OXVe3fROTB/n61jN34cF+4WjSvye74rsjdvY='
WHERE
key_id = '71f9223b15f73c0a39e7945eeee1cc3740ca7916313fef8c86fad8244f028411'
AND (
token = '1JwHiw1OXVe3fROTB/n61jN34cF+4WjSvye74rsjdvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)