UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jCc+TDAU+EtuqmiBLFQcz35bFQ1bSuYm3bsHz6sGlzY='
WHERE
key_id = '5a81ee793b613bcba61407b97a946f46ce2f9a82e3c0a8f2edc29ad689f7676e'
AND (
token = 'jCc+TDAU+EtuqmiBLFQcz35bFQ1bSuYm3bsHz6sGlzY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)