UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7EX8/uoAmgje3w9rtggMv1pamrfeOvBoYDbQf5Sxy/4='
WHERE
key_id = '9e3ac0248e6ea22c04cb0ca4a964dec3fa1eaf87f02d746e54db509b537f1176'
AND (
token = '7EX8/uoAmgje3w9rtggMv1pamrfeOvBoYDbQf5Sxy/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)