UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Bsn8MEwhyrK4HxGZhJC1TBL+a+zm6pKUzlsOcgQqG8='
WHERE
key_id = '9d3266264cf909043a423869ac556029b9794841a9122294faf730cde5eae5f6'
AND (
token = '/Bsn8MEwhyrK4HxGZhJC1TBL+a+zm6pKUzlsOcgQqG8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)