UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bQM2lYM17MNWOGqIKkcOzshPjnYlmyIn/Y1SxDMSO6s='
WHERE
key_id = 'b74c75ba655912839b6673285ed461192b39878b9503677bbd297a9489f7a05f'
AND (
token = 'bQM2lYM17MNWOGqIKkcOzshPjnYlmyIn/Y1SxDMSO6s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)