UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DsmtWGO16kTs+Wyni2eDJdfhjvJUU8UOCVmUA8IHtQk='
WHERE
key_id = 'e657a046702249690b2eeb209185d15eadd500e5279ce6afcfd888ab0ad7011d'
AND (
token = 'DsmtWGO16kTs+Wyni2eDJdfhjvJUU8UOCVmUA8IHtQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)