UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TmPrIUfvB8RhSM4u51a8ZcriwOt53Og8BcAeKiRdpUw='
WHERE
key_id = '035ee432fffbbb7ad628121a59230de8d5252dc61363d79b0f115318aede8001'
AND (
token = 'TmPrIUfvB8RhSM4u51a8ZcriwOt53Og8BcAeKiRdpUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)