UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3qeR8rZ0xMWp1yvHRZNwytQIDP3jzfj77ITKu7NrBO4='
WHERE
key_id = '335b7404a35b831dc5a1281bb77b96c8adc85aeca8e045c088b9429695d3a15b'
AND (
token = '3qeR8rZ0xMWp1yvHRZNwytQIDP3jzfj77ITKu7NrBO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)