UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '48kku+EN25h8zVSrnPJWcWs0TOqJhC+C2cPmb9QnSeU='
WHERE
key_id = 'da52b1b529dcf0c260a8618135c8df4156787f0ff7c595d56ae2158235b8dfa7'
AND (
token = '48kku+EN25h8zVSrnPJWcWs0TOqJhC+C2cPmb9QnSeU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)