UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/0AngrBCpnSOK0zNrrR8t7wZOA6mjroy+wvUtdXVvoE='
WHERE
key_id = '8dde41ed666f4da91bfc049c379e05231fabcedc31a2c5c2df1eaf49c9443c62'
AND (
token = '/0AngrBCpnSOK0zNrrR8t7wZOA6mjroy+wvUtdXVvoE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)