UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aRlV7SP7CmHrBIiluv8ZdEsDT+vawcKiYrFvb6e716Q='
WHERE
key_id = '2041ba1bd61d5f4728e539e14dfcedc49b66b0fb098e83fbeb9dffd4f3b80c9a'
AND (
token = 'aRlV7SP7CmHrBIiluv8ZdEsDT+vawcKiYrFvb6e716Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)