UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K+e/XvvqenOsRDHTs91fl0q3upKKQ5Oyqz0SAKBmPJI='
WHERE
key_id = 'a0226ff6326c9b519c33234dc66b913cf65002fc65bfdd7ec8ab074ffa4d1227'
AND (
token = 'K+e/XvvqenOsRDHTs91fl0q3upKKQ5Oyqz0SAKBmPJI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)