UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WbNfB2gv/WjalQbZcOqj1XU7uLh/hGOmD2dYx6icBtA='
WHERE
key_id = '021aa2ce7fe88c9c940d4ae75a01a2c0c55d9a92fd8245eecc0975dfc89506cc'
AND (
token = 'WbNfB2gv/WjalQbZcOqj1XU7uLh/hGOmD2dYx6icBtA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)