UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NMJf5PK9HIZOs8Cw26Wl64kq5ncbSQW6eUyb/7oML1k='
WHERE
key_id = '5b17a42315b24fa49095b68be207a12913d50ece42a5b2488df3ce4dcae4d73e'
AND (
token = 'NMJf5PK9HIZOs8Cw26Wl64kq5ncbSQW6eUyb/7oML1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)