UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/bYS5Waisp+PeBtIeKzFPsyFNF9Pnj+wAUK8XYtoymI='
WHERE
key_id = 'd691e021e22b4373fd6a6067212526386d81f3d64bc74f48e2e0b228f8a61b58'
AND (
token = '/bYS5Waisp+PeBtIeKzFPsyFNF9Pnj+wAUK8XYtoymI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)