UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ahBOKSC4E1pBgZUllk1sghB8Vbb1gKwZMETEs3bPl/k='
WHERE
key_id = '02d5f075c2352c00dc193ad7392d0f673f3a1c3e58bf33190e89d431071c2263'
AND (
token = 'ahBOKSC4E1pBgZUllk1sghB8Vbb1gKwZMETEs3bPl/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)