UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zLm+OidD2UWBxtPcBHVaflYa3rYfUDmq+7Mzs16CoD0='
WHERE
key_id = '7583551b4221169f753d35f35cc5e8faa1aa1bbbdfa97aa570acfeeb64695447'
AND (
token = 'zLm+OidD2UWBxtPcBHVaflYa3rYfUDmq+7Mzs16CoD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)