UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H3YGlQsNUB8Chfasve2I2f5O5+W7snD/K+xE2aSH2RM='
WHERE
key_id = 'a73acefc305ee5a5dd557c1d93da3a87baf300e37a617a2ff43f681fa77417ac'
AND (
token = 'H3YGlQsNUB8Chfasve2I2f5O5+W7snD/K+xE2aSH2RM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)