UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iYZRcG4atZH1VK/D2fZAdVmZ6CrsbMAp1bNwxJotlOc='
WHERE
key_id = 'df2e1711d2e8bc17ee3f468e60e8f767468c7ebc1184e5ca5dd652ad47fd03cc'
AND (
token = 'iYZRcG4atZH1VK/D2fZAdVmZ6CrsbMAp1bNwxJotlOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)