UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VAWxgq7Wx3bYkztOU7QxMw/Oqcj4wtEHjiy5FzI/lx0='
WHERE
key_id = 'a41c2d8f6d5803970808e5d717fffbc3594645b2bf7fd16f0daa341cbddd2d44'
AND (
token = 'VAWxgq7Wx3bYkztOU7QxMw/Oqcj4wtEHjiy5FzI/lx0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)