UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hJzsZ0+wzayQKLDVwxVwJThQyqf2wFmDGQD5ePWqFsY='
WHERE
key_id = 'c86de6a70fd22430033ef361d9eb0c7a23519fadfb9a0cf058099ce5cbab22a3'
AND (
token = 'hJzsZ0+wzayQKLDVwxVwJThQyqf2wFmDGQD5ePWqFsY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)