UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't4ZuISIpJMLcsN+Q+w9XqZeGq2keaQx5S1NRUllIPEA='
WHERE
key_id = '43ddf20f1aaafecd43f203918e28bf2812a05522a250ec967b0b5d159558f738'
AND (
token = 't4ZuISIpJMLcsN+Q+w9XqZeGq2keaQx5S1NRUllIPEA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)