UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rS8zbhEX9+O2+E8s9APWQ+Ro3nNaw8aKuaDfyw4RbLY='
WHERE
key_id = '2ab11fb957a2dd95f8700dd59b80e56f4fef8855b99a9af42608d2413c341f9d'
AND (
token = 'rS8zbhEX9+O2+E8s9APWQ+Ro3nNaw8aKuaDfyw4RbLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)