UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hzrJgmFTux6vrgV7gVwnlFugL/4NnoOqc1SIx7i+rAk='
WHERE
key_id = 'f1673cca4c6311c2e916fb5185b35fc8c1d6bf2de24e61701977d6e1cddac12a'
AND (
token = 'hzrJgmFTux6vrgV7gVwnlFugL/4NnoOqc1SIx7i+rAk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)