UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '99ziLXxc7cw3eRni+uZ3w4DZveWcfHtxGYbwTJ2Fc0Y='
WHERE
key_id = 'd9e7ca0de1ea42d96b6f2f820ae49d0722b062af6e892f03f082a2d4e1303534'
AND (
token = '99ziLXxc7cw3eRni+uZ3w4DZveWcfHtxGYbwTJ2Fc0Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)